package ls.ch01.demo6;

/**
 * @author ls
 * @Date 创建时间:2022/4/4 19:01
 * 描述:
 */

public class Demo6 {
    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException {
        Class clz = Class.forName("com.ls.ch01.demo1.Person");  //加载Person类
        Object obj = clz.newInstance(); //调用Person类的无参构造创建Person类实例
        System.out.println(obj);    //调用Person实例的toString()方法，属性均为默认值
    }
}
